#pragma once
#include "elisa/elisa.h"
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <gaol/gaol>

#include "Modeler.h"

#ifdef ELISA_PERFORMER
#include "elisa_chrono.h"
#endif

using namespace std;
using namespace elisa;

class Wilkinson : public Modeler
{
private:
	Model _model;

	RealVar x;
	RealConstraint c1;

public:
	Wilkinson()
		: x(Interval(-100,10), "x"),
		  c1(0 == (x+1)*(x+2)*(x+3)*(x+4)*(x+5)*(x+6)*(x+7)*(x+8)*(x+9)*(x+10)*
		     (x+11)*(x+12)*(x+13)*(x+14)*(x+15)*(x+16)*(x+17)*(x+18)*(x+19)*(x+20)
			 +0.11920928955078125e-6*pow(x,19)),
		  _model()
	{
	}

	elisa::Model & model()
	{
		_model = c1;
		return _model;
	}

	void print()
	{
		cout << '\t' << x.getName() << " = " << x.domain() << endl;
	}

	RealVar & varX()
	{
		return x;
	}
	RealVar & varY()
	{
		return x;
	}
};
